<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="viewport" content="width=device-width,user-scalable=0"/>
    <meta charset="UTF-8">
    <title>个人信息</title>
    <script src="__api__/js/fontSize.js"></script>
    <link rel="stylesheet" href="__api__/css/bootstrap.min.css">
    <link rel="stylesheet" href="__api__/css/reset.css">
    <link rel="stylesheet" href="__api__/css/my_main.css">
    <link rel="stylesheet" href="__api__/css/layer-animate.css">
    <link rel="stylesheet" href="__api__/css/weui.min.css">
    <link rel="stylesheet" href="__api__/css/jquery-weui.min.css">
    <link rel="stylesheet" href="__assets__/css/layui.css" media="all">
    <style>
        body{
            background-color: #ebebeb;
        }
        .toolbar{
            background: none;
        }
        .weui-picker-modal{
            background: none;
            bottom: 1.5rem;
        }
        .weui-select-modal .weui-cells{
            margin-left: 0.37rem;
            margin-right: 0.37rem;
            height: 1.97rem;
            text-align: center;
            font-size: 0.32rem;
            color: #666666;
            font-weight: 100;
            border-radius: 5px;
            overflow-y: hidden;
        }
        .weui-picker-container, .weui-picker-overlay{
            height: 100%;
            background-color: rgba(0,0,0,0.4);

        }
        .weui-cell{
            font-weight: 100;
            padding: 13px 15px;
        }
        .toolbar .picker-button {
            position: absolute;
             right: 0.37rem;
            left: 0.37rem;
            box-sizing: border-box;
            height: 0.78rem;
            line-height: 0.78rem;
            width: 90%;
            background: #ff8903;
            color: #fff;
            z-index: 1;
            bottom: -3.4rem;
            font-size: 0.36rem;
            border-radius: 5px;
        }
        .toolbar:before{
            background: none;
        }
    </style>
</head>
<body>
<div class="mod_info">
<form action="#" onsubmit="return false">
    <div class="mod_box">
        <div class="head_img open-popup" data-target="#headImg">
            <div class="head-img">
                <img src="{$data.headimgurl}">
            </div>
            <div class="camera">
                <img src="__api__/images/camera.png">
            </div>

        </div>
        <div class="mod">
            <div class="info_list open-popup" data-target="#mod_name">
                <div class="container">
                    <div class="infoList">
                        <div class="info_p pull-left">
                            <p>昵称</p>

                        </div>
                        <div class="info_a pull-right">
                            <span><input type="text" value="{$data.nickname}" name="nickname"></span>
                        </div>
                    </div>

                </div>
            </div>
            <div class="info_list open-popup">
                <div class="container">
                    <div class="infoList">
                        <div class="info_p pull-left">
                            <p>性别</p>

                        </div>
                        <div class="info_a pull-right">
                            <input class="weui-input" id="job" type="text" value='男神' readonly="" data-values="女神" name="sex">
                        </div>
                    </div>

                </div>
            </div>
            <div class="info_list">
                <div class="container">
                    <div class="infoList">
                        <div class="info_p pull-left">
                            <p>生日</p>

                        </div>
                        <div class="info_a pull-right">
                           <input type="text" class="layui-input" id="date2" name="birtday" value="{$data.birtday}">
                        </div>
                    </div>

                </div>
            </div>
            <div class="info_list">
                <div class="container">
                    <div class="infoList">
                        <div class="info_p pull-left">
                            <p>所在城市</p>

                        </div>
                        <div class="info_a pull-right">
                            <input id="demo1" type="text" readonly placeholder="城市选择特效"  value="{$data.province}" name="province"/>
                            <input id="value1" type="hidden" value="20"/>
                        </div>
                    </div>

                </div>
            </div>

                <div class="info_list">
                    <a href="{:url('api/userinfo/modphone')}">
                    <div class="container">
                        <div class="infoList">
                            <div class="info_p pull-left">
                                <p>修改手机号</p>

                            </div>
                            <div class="info_icon pull-right">
                                <img src="__api__/images/right_color.png">
                            </div>
                        </div>

                    </div>
                    </a>
                </div>


            <div class="info_list open-popup" data-target="#person">
                <div class="container">
                    <div class="infoList">
                        <div class="info_p pull-left">
                            <p>个人说明</p>

                        </div>
                        <div class="info_icon pull-right">
                            <img src="__api__/images/right_color.png">
                        </div>
                    </div>

                </div>

            </div>

        </div>

    </div>
    <div id="headImg" class="weui-popup__container popup-bottom">
        <div class="weui-popup__overlay"></div>
        <div class="weui-popup__modal">
            <a href="javascript:">
                <div class="modal-content">
                    <span>从手机相册选择</span>
                </div>
            </a>

            <button class="per_btn close-popup">取消</button>
        </div>
    </div>
    <div id="sex" class="weui-popup__container popup-bottom">
        <div class="weui-popup__overlay"></div>
        <div class="weui-popup__modal">
            <div class="modal-content">
                <a href="javascript:">男神</a>
                <a href="javascript:">女神</a>
            </div>
            <button class="per_btn close-popup">取消</button>
        </div>
    </div>
    <div id="person" class="weui-popup__container popup-bottom">
        <div class="weui-popup__overlay"></div>
        <div class="weui-popup__modal">

            <div class="modal-content">
                <textarea rows="3" name="signature">{$data.signature}</textarea>
            </div>
            <button class="per_btn close-popup">确定</button>
        </div>
    </div>
    <div id="mod_name" class="weui-popup__container popup-bottom">
        <div class="weui-popup__overlay"></div>
        <div class="weui-popup__modal">

            <div class="modal-content">
                <input type="text" id="username" name="nickname" value="{$data.nickname}">
            </div>
            <button class="per_btn close-popup">确定</button>
        </div>
    </div>
    <div class="mod_btn">
        <div class="container">
            <button class="Btn" id="sub">保存</button>
        </div>

    </div>
    </form>
</div>


<script src="__assets__/js/jquery.min.js"></script>
<script src="__api__/js/bootstrap.min.js"></script>
<script src="__api__/js/jquery-weui.min.js"></script>
<script src="__api__/js/datePicker.js"></script>
<script src="__api__/js/method.js"></script>
<script src="__api__/js/LAreaData1.js"></script>
<script src="__api__/js/LAreaData2.js"></script>
<script src="__api__/js/LArea.js"></script>
<script src="__api__/js/popup.js"></script>
<script src="__assets__/layui.js"></script>
<script>
    // 修改生日
 $(function(){
	var layer;
	 layui.use('layer', function(){
		   layer = layui.layer;
		  
		 // layer.msg('hello');
		});       
	 
	 layui.use('laydate', function(){
	   var laydate = layui.laydate;
	   
	   //执行一个laydate实例
	   laydate.render({
	     elem: '#date2' //指定元素
	   });
	 });
	 $('#sub').click(function(){
		 var url="{:url('api/userinfo/updateinfo')}";
		 var data=$("form").serialize();
		 $.post(url,data,function(res){
			 var obj=eval('(' + res +')');
			 console.log(obj);
			 var status=obj.status;
			 var info=obj.info;
			 if(status==1){
				 layer.msg(info,{icon:6},function(){
					 window.location.href=obj.data;
				 });
			 }else{
				 layer.msg(info,{icon:5});
			 }
		 })
	 })
	
 })
    
</script>

</body>
</html>